package com.lsyw.intergrate.serviceImpl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lsyw.intergrate.entity.TransportWorkOrderAbnormal;
import com.lsyw.intergrate.entity.TransportWorkOrderAbnormal;
import com.lsyw.intergrate.mapper.RouteMapper;
import com.lsyw.intergrate.mapper.TransportWorkOrderAbnormalMapper;
import com.lsyw.intergrate.service.TransportWorkOrderAbnormalService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * <p>
 * 运输工单告警信息 服务实现类
 * </p>
 *
 * @author 刘磊
 * @since 2023-12-26
 */
@Service
public class TransportWorkOrderAbnormalServiceImpl extends ServiceImpl<TransportWorkOrderAbnormalMapper, TransportWorkOrderAbnormal> implements TransportWorkOrderAbnormalService {
    @Autowired
    private RouteMapper routeMapper;

    @Override
    public IPage<TransportWorkOrderAbnormal> pageList(Page<TransportWorkOrderAbnormal> page, Map<String, Object> condition) {
        return baseMapper.pageList(page, condition);
    }

    @Override
    public TransportWorkOrderAbnormal getInfoById(String id) {
        TransportWorkOrderAbnormal transportWorkOrderAbnormal =baseMapper.getInfoById(id);
        transportWorkOrderAbnormal.setRoute(routeMapper.selectById(transportWorkOrderAbnormal.getRouteId()));
        return transportWorkOrderAbnormal;
    }
}
